package selenium.pages;

import org.openqa.selenium.By;

import java.util.List;

public class SearchResultsPage extends AnyPage {

    public SearchResultsPage(PageManager pages) {
        super(pages);
    }

    public int getFilmLinksCount (String filmName) {
        List rows = driver.findElements(By.linkText(filmName));
        return rows.size();
    }
    
    public SearchResultsPage ensurePageLoaded () {
        driver.findElement(By.xpath("//h3[text()='Results from IMDb']"));
        return this;
    }
}
